<?php
/**
 * Created by PhpStorm.
 * User: zhj
 * Date: 2019/1/16
 * Time: 17:35
 */
namespace app\common\validate;

/**
 *  商品验证器
 */
class Car extends ValidateBase
{
    // 验证规则
    protected $rule =   [
        'userid'          => 'require|number',
        'goodsid'       => 'require|number',
    ];

    // 验证提示
    protected $message  =   [
        'userid.require'         => '用户id不能为空',
        'userid.number'         => '用户id必须为数字',
        'goodsid.require'      => '商品id不能为空',
        'goodsid.number'      => '商品id必须为数字',
    ];

    // 应用场景
    protected $scene = [
        'add'  =>  ['userid', 'goodsid']
    ];
}